The present invention relates to a waveshaping circuit for the switch input signal of a digital integrated circuit such as a microcomputer.
FIG. 1 is a circuit diagram of a prior-art waveshaping circuit of the type specified above. In the figure, numeral 1 designates a D.C. power source which is, for example, a battery of 14 V for automobiles, numeral 100 a control device which is connected with the power source 1, and numeral 101 a switch which is connected with the control device 100. Numeral 2 designates a voltage regulator circuit by which the voltage of 14 V supplied from the D.C. power source is regulated to a voltage of 5 V. A pull-up resistor 3 having a resistance of 820.OMEGA. is connected between a 14 V voltage line and the switch 101, a resistor 4 of 6.8 k.OMEGA. has its one end connected to the node of the resistor 3 and the switch 101, and a capacitor 5 having a capacitance of 10 .mu.F is connected with the other end of the resistor 4 and constitutes a low-pass filter. A protective diode 12 serves to limit a voltage magnitude when a minus voltage is input. A resistor 13 of 2.2 k.OMEGA. provides a voltage divider together with the resistor 4, an N-P-N transistor 14 has its base connected to the output of the voltage divider, and a resistor 16 of 10 k.OMEGA. is connected to the collector of the transistor 14 and a 5 V line being the output of the voltage regulator circuit 2. Shown at numeral 10 is a microcomputer which receives the collector voltage of the transistor 14 as a digital input signal.
Next, the operation of the circuit shown in FIG. 1 will be described. When the switch 101 is in its open state, the transistor 14 is supplied with a base current through the resistors 3 and 4. Therefore, this transistor 14 is turned `on`, and the input voltage E of the microcomputer 10 becomes 0 (zero) volt. On the other hand, when the switch 101 is in its closed state, the voltage of a node A becomes 0 (zero) volt. Therefore, the transistor 14 is turned `off`, and the voltage of the node E becomes 5 V.
The voltage of the node A according to which the transistor 14 changes into the `on` or `off` state is determined by the base-emitter voltage (approximately 0.7 V) of the transistor 14 and the voltage divider composed of the resistors 4 and 13 because the current of the transistor 14 is high. In the case of FIG. 1, the transistor 14 turns `on` when the voltage of the node A is approximately 2.9 volts or above, and it turns `off` when the voltage is below the same value. The capacitor 5 forms together with the resistor 4, a low-pass filter which prevents the transistor 14 from erroneously operating due to noise that is induced in the harness for connections between the switch 101 and the control device 100.
Since the prior-art waveshaping circuit is arranged as described above, it has the disadvantage that the comparison level for the input voltage is subject to fluctuation when the base-emitter voltage of the transistor 14 changes according to the ambient temperature thereof. Another problem is high cost when a transistor 14 is used.